package com.uu.it.tracker.computation;

import com.uu.it.tracker.sensordata.SensorData;
import com.uu.it.tracker.sensordata.SensorData.Gestures;

public class TrackerData {
	SensorData curArmData;
	SensorData curLegData;
	SensorData prevArmData;
	SensorData prevLegData;
	
	public TrackerData(SensorData pArmData, SensorData cArmData,
			SensorData pLegData, SensorData cLegData){
		curArmData = cArmData;
		prevArmData = pArmData; 
		curLegData = cLegData;
		prevLegData = pLegData; 
	}
	public boolean isInStandingRange(){
		if(curArmData.isInStandingRange(prevArmData)
				|| curLegData.isInStandingRange(prevLegData))
			return true;
		else return false;
	}
	public boolean isInWalkingRange(){
		if(curArmData.isInWalkingRange(prevArmData)
				|| curLegData.isInWalkingRange(prevLegData))
			return true;
		else return false;		
	}
	public boolean isInRunningRange(){
		if(curArmData.isInRunningRange(prevArmData)
				|| curLegData.isInRunningRange(prevLegData))
			return true;
		else return false;	
	}
	public float computeProportion(Gestures g){
		float armProportion = curArmData.computeProportion(g, prevArmData);
		float legProportion = curLegData.computeProportion(g, prevLegData);
		return (armProportion + legProportion) / 2 ;
	}
	
}
